package model.commands.environment;

import java.util.List;
import model.Environment;
import model.SyntaxErrorException;
import model.commands.Command;


/**
 * Name:
 * TELL [ commandable(s) ]
 * 
 * Description:
 * sets commandables that will follow commands hereafter
 * returns last value in commandables list
 * note, if commandable has not previously existed, it is created and placed at the home location
 * note, if more than one commandable is active, commands run return value associated with the last
 * active commandable
 * 
 * @author Erick Gonzalez
 */
public class TellCommand extends Command {
    private List<Integer> myCommandableIds;
    
    /**
     * 
     * @param commandableIds a list of commandable ids
     */
    public TellCommand(List<Integer> commandableIds) {
        myCommandableIds = commandableIds;
    }
    
    @Override
    public int evaluate (Environment e) throws SyntaxErrorException {
        e.activateCommandables(myCommandableIds);
        return 1;
    }

}
